{% extends 'base.html' %}
{% load staticfiles %}
{% load myfilter %}
{% block left_content %}
    <div class="postdate">
      <div class="month">{{ article.date_publish | month_to_upper }}</div>
      <div class="date">{{ article.date_publish | date:'d' }}</div>
    </div>
    <div class="title">
        <h2><a href="" rel="bookmark" title="{{ article.title }}">{{ article.title }}</a></h2>
        <div class="postmeta">
          <span class="postmeta_author">{{ article.user.username }}</span>
          <span class="postmeta_category"><a href="" rel="category">{{ article.category.name }}</a></span>
          <span class="postmeta_time">{{ article.date_publish | date:'Y-m-d' }}</span>
        </div>
    </div>
        <div class="entry">
          {{ article.content | safe }}
        </div>
        <span class="tags">
            {% for tag in article.tag.all %}
                <a href="?tag={{ tag.name }}" rel="tag">{{ tag.name }}</a>
            {% endfor %}
        </span>
        <div class="info">
        Address:  <a href="{{ SITE_URL }}article/?id={{ article.id }}" rel="bookmark" title="{{ article.title }}">{{ SITE_URL }}article/?id={{ article.id }}</a>
        </div>
      <div class="commentstitle"><h3 id="comments">
          <span class="commentsnumber">仅 2 条评论</span> 直到现在</h3>
      </div>
      <ol class="commentlist">
          {% for comment in comment_list %}
          <li id="comment-59418">
                <div class="top"><a href='{{ comment.url }}' rel='external nofollow' class='url'>{{ comment.username }}</a>
                    <span class="time"> @ <a href="#comment-59418" title="">{{ comment.date_publish | date:'Y-m-d H:i:s' }}</a></span>
                </div>
                <div>
                    <img alt='' src='{% static 'images/default.jpg' %}' class='avatar avatar-32 photo' height='32' width='32' /></div>
                <div class="body">
                    <p>{{ comment.content }}</p>
                </div>
          </li>
          {% for children_comment in comment.children_comment %}
          <li id="comment-59542">
                <div class="reply">
                  <div class="top"><a href="{{ children_comment.url }}" rel="external nofollow" class="url">{{ children_comment.username }}</a>
                      <span class="time"> @ <a href="#comment-59543" title="">{{ children_comment.date_publish | date:'Y-m-d H:i:s' }}</a></span>
                  </div>
                  <div>
                      <img alt="" src="{% static 'images/default.jpg' %}" class="avatar avatar-32 photo" height="32" width="32">
                  </div>
                  <div class="body">
                      {{ children_comment.content }}
                  </div>
                </div>
          </li>
          {% endfor %}
          {% endfor %}
      </ol>

    <div id="commentform">
    <h3 id="respond">发表一下所思所想</h3>
    {% if not request.user.is_authenticated %}
    <div class='login_info'>还没有登陆？可以登录后再评论哦也可以在下方填写必要信息进行评论。<b><a href="{% url 'login' %}">&raquo;去登录</a>&nbsp;<a href="{% url 'reg' %}">&raquo;去注册</a></b></div>
    {% else %}
    <div class='login_info'>
        <b>{{ request.user.username }}</b>快来写点评论吧!<span class="red">&raquo;<a href="{% url 'logout' %}">注销</a></span></div>
    {% endif %}
    <form action="{% url 'comment_post' %}" method="post">
    {#安全验证#}
    {% csrf_token %}
    <p>{{ comment_form.author }}
        <label for="author">Name (必须填写)</label>
    </p>

    <p>{{ comment_form.email }}
        <label for="email">Email (不会被公开) (必须填写)</label>
    </p>

    {#   <p>{{ comment_form.url }}#}
{#    <label for="url">URL</label></p>#}


    <!--<p><small><strong>XHTML:</strong> You can use these tags: &lt;a href=&quot;&quot; title=&quot;&quot;&gt; &lt;abbr title=&quot;&quot;&gt; &lt;acronym title=&quot;&quot;&gt; &lt;b&gt; &lt;blockquote cite=&quot;&quot;&gt; &lt;cite&gt; &lt;code class=&quot;&quot; title=&quot;&quot; data-url=&quot;&quot;&gt; &lt;del datetime=&quot;&quot;&gt; &lt;em&gt; &lt;i&gt; &lt;q cite=&quot;&quot;&gt; &lt;strike&gt; &lt;strong&gt; &lt;pre class=&quot;&quot; title=&quot;&quot; data-url=&quot;&quot;&gt; &lt;span class=&quot;&quot; title=&quot;&quot; data-url=&quot;&quot;&gt; </small></p>-->

    <p>{{ comment_form.comment }}</p>

    <p>
        {{ comment_form.article }}
        <input name="submit" type="submit" id="submit" tabindex="5" value="Submit" class="button" />
    </p>
    </form>
    </div>
{% endblock %}